# Contributor: Aiden Grossman <agrossman154@yahoo.com>
# Maintainer: Aiden Grossman <agrossman154@yahoo.com>
pkgname=jupyter-nbconvert
pkgver=6.5.0
pkgrel=1
pkgdesc="Notebook conversion tool for jupyter"
url="https://github.com/jupyter/nbconvert"
arch="noarch"
license="BSD-3-Clause"
depends="py3-entrypoints
	py3-traitlets
	jupyter-nbformat
	py3-jinja2
	py3-defusedxml
	py3-mistune1
	py3-pygments
	py3-pandocfilters
	py3-jupyterlab_pygments
	jupyter-nbclient
	py3-bleach
	py3-jupyter_core
	py3-testpath
	"
checkdepends="py3-pytest py3-ipykernel py3-beautifulsoup4"
makedepends="py3-setuptools"
source="$pkgname-$pkgver.tar.gz::https://github.com/jupyter/nbconvert/archive/refs/tags/$pkgver.tar.gz
	deprecation-warnings.patch
	mistune1.patch
	"
builddir="$srcdir/nbconvert-$pkgver"

build() {
	python3 setup.py build
}

check() {
	# TestWebPDFExporter and TestNbConvertApp both require chromium to run tests
	pytest \
		-k 'not TestWebPDFExporter and not TestNbConvertApp' \
		--deselect nbconvert/exporters/tests/test_export.py::TestExport::test_export_disabled \
		--deselect nbconvert/exporters/tests/test_export.py::TestExport::test_export_filename \
		--deselect nbconvert/exporters/tests/test_export.py::TestExport::test_export_filestream \
		--deselect nbconvert/exporters/tests/test_export.py::TestExport::test_export_nbnode \
		--deselect nbconvert/exporters/tests/test_exporter.py::TestExporter::test_get_export_names_disable \
		--deselect nbconvert/exporters/tests/test_exporter.py::TestExporter::test_get_exporter_disable_config_exporters \
		--deselect nbconvert/exporters/tests/test_script.py::TestScriptExporter::test_export \
		--deselect nbconvert/exporters/tests/test_script.py::TestScriptExporter::test_export_config_transfer \
		--deselect nbconvert/exporters/tests/test_script.py::TestScriptExporter::test_export_python
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="
2cbdbbc1e422289052974f39ab3f09c0da35a29f72b4495bc2bef0dd010c00f6ffefed75fe3d81d06a9d223014239c8c56edd3c1f96c428ee0382110a1cc47ea  jupyter-nbconvert-6.5.0.tar.gz
02f53525c21be24c6891b0ad046cb1554f0ade1db47f1c935784dd496386b167167439a9c8152eaf73261fb775b52c0af9b7ad89064185fb52b74882f84e83d0  deprecation-warnings.patch
c87f16141442cfbf57f6349d2146f4fb0ab1087cefb17d5d0ec39fb43868cb06168820efa9324791fc32d4833b153a4fd1c017353b5840a7dacf50277b4934b1  mistune1.patch
"
